Crate profont[][src]

Expand description

The ProFont monospace programming font for use with embedded-graphics. Font data taken from the ProFont homepage.

Examples

Draw the text “Hello world” to a mock display using the 7pt Pro Font font.

use embedded_graphics::{
    mock_display::MockDisplay,
    mono_font::MonoTextStyle,
    pixelcolor::Rgb888,
    prelude::*,
    text::Text,
};
use profont::PROFONT_7_POINT;

let mut display = MockDisplay::new();

let text_style = MonoTextStyle::new(&PROFONT_7_POINT, Rgb888::RED);

Text::new("Hello world", Point::new(0, 7), text_style).draw(&mut display)?;

For a more complete example see the example in the ssd1675 crate.

Glyph Coverage

This crate provides support for ISO/IEC 8859-1 (latin1), although do note that the font is missing a few glyphs in this range.

Constants

PROFONT_7_POINT

The 7 point size with a character size of 5x9 pixels.

PROFONT_9_POINT

The 9 point size with a character size of 6x11 pixels.

PROFONT_10_POINT

The 10 point size with a character size of 7x13 pixels.

PROFONT_12_POINT

The 12 point size with a character size of 8x15 pixels.

PROFONT_14_POINT

The 14 point size with a character size of 10x18 pixels.

PROFONT_18_POINT

The 18 point size with a character size of 12x22 pixels.

PROFONT_24_POINT

The 24 point size with a character size of 16x30 pixels.